﻿@using VirtualPress.Infrastructure.Entities.Entity;
@using VirtualPress.Infrastructure.HitMonitor;
@using VirtualPress.Tool.Framework;
@using VirtualPress.Infrastructure.Entities.Enum;
@{
    Periodical journal = ViewBag.Journal;
    ViewBag.Title = "起始页 - " + journal.Name;
    Layout = "/Areas/WorkSpace/Views/Shared/_WorkSpace.cshtml";
    var hit = HitMonitor.Instance(HitName.Journal, journal.Id).GetValue<JournalHitPack>();
}
<div id="content-header">
    <h1>
        期刊控制台</h1>
    <div class="btn-group">
        <a class="btn tip-bottom" href="/Journals/Home/Detail/@journal.Id" title="点击进入期刊" target="_blank">
            进入期刊<i class="icon-play"></i></a>
    </div>
</div>
<div id="breadcrumb">
    <a href="javascript:" class="tip-bottom"><i class="icon-home"></i>起始页</a>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="alert alert-info">
            欢迎使用中华科教出版社学术期刊采编平台！<a href="javascript:" data-dismiss="alert" class="close"
                title="关闭"><i class="icon-remove"></i></a>
        </div>
        <div class="span12 center" style="text-align: center;">
            <ul class="stat-boxes">
                <li>
                    <div class="left peity_bar_good">
                        <span>2,4,9,7,12,10,19</span></div>
                    <div class="right">
                        <strong>@hit.VisitNumber</strong> 期刊访问量
                    </div>
                </li>
                <li>
                    <div class="left peity_bar_neutral">
                        <span>20,15,18,14,10,9,9,9</span></div>
                    <div class="right">
                        <strong>@hit.DownloadNumber</strong> 期刊下载量
                    </div>
                </li>
                <li>
                    <div class="left peity_bar_bad">
                        <span>3,5</span></div>
                    <div class="right">
                        <strong>@ViewBag.ArticleCount</strong> 稿件量
                    </div>
                </li>
                <li>
                    <div class="left peity_line_good">
                        <span>12,6,9,23,14</span></div>
                    <div class="right">
                        <strong>@ViewBag.JournalItemCount</strong> 发布期刊
                    </div>
                </li>
            </ul>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span6">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-file"></i></span>
                    <h5>
                        待处理稿件</h5>
                    @{
                        int newArticleCount = ViewBag.NewArticleCount;
                        int waitArticleCount = ViewBag.WaitArticleCount;
                        List<Article> articles = ViewBag.WaitProccess;
                    }
                    <span title="最新稿件数" class="label label-info tip-left">@(newArticleCount + waitArticleCount)</span></div>
                <div class="widget-content nopadding">
                    <ul class="recent-posts">
                        @if (articles != null && articles.Any())
                        {
                            foreach (var item in articles)
                            {
                            <li>
                                <div class="article-post">
                                    <p>
                                        <a href="/workspace/console/articledetail/@item.Id">@item.Title</a>
                                        <p>
                                            <span class="user-info">@item.Abstract.PieceOfString(0, 50, "......")<br />
                                                on @item.CreateTime.ToString("dd MMM yyyy")</span>
                                        </p>
                                    </p>
                                    @if (item.Status == VirtualPress.Infrastructure.Entities.Enum.ArticleStatus.Open)
                                    {
                                        <a href="/workspace/console/newmanuscriptcheck/@item.Id" class="btn btn-primary btn-mini">
                                            初审</a>
                                    }
                                    else
                                    {
                                        <a href="/workspace/console/article?group=1" class="btn btn-primary btn-mini">查看</a>
                                    }
                                    <a href="javascript:" class="btn btn-danger btn-mini" onclick="cancelarticle(@item.Id)">
                                        删除</a>
                                </div>
                            </li>
                            }
                        }
                        else
                        { 
                            <li>
                                <div class="article-post">
                                    <p>
                                        <a>没有待处理稿件</a>
                                        <p>
                                            <span class="user-info">您的期刊暂时没有待处理稿件，当你有新稿件，或专审需要分配等稿件需要您操作时这里会显示它们。<br />
                                                -- @DateTime.Now.ToString("yyyy年 MM月 dd日")</span>
                                        </p>
                                    </p>
                                </div>
                            </li>
                        }
                    </ul>
                </div>
            </div>
        </div>
        <div class="span6">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-book"></i></span>
                    <h5>
                        编委会</h5>
                    <span title="编委会成员" class="label label-info tip-left">0</span></div>
                <div class="widget-content nopadding">
                    <ul class="recent-comments">
                        @{
                            List<Organization> counsellor = ViewBag.Counsellor;
                            if (counsellor != null && counsellor.Any())
                            {
                                foreach (var expert in counsellor)
                                {
                                <li>
                                    <div class="user-thumb" style="height: 60px; width: 50px">
                                    @if(String.IsNullOrEmpty(expert.user.Photo))
                                    {
                                        <img alt="没有上传照片" style="height: 60px; width: 50px" src="/Content/img/demo/av3.jpg" />
                                    }
                                    else
                                    {
                                        <img alt="@expert.user.NickName" style="height: 60px; width: 50px" src="@expert.user.Photo" />
                                    }
                                    </div>
                                    <div class="comments">
                                        <p>
                                            <a>@expert.user.NickName</a>
                                        </p>
                                        <p>
                                            <span class="user-info">@expert.expert.Degree @expert.user.Area.Mapping(). @expert.user.Location.Mapping()  --@expert.expert.Institution
                                            <br />
                                                <a href="/workspace/console/Counsellor" class="btn btn-primary btn-mini">查看</a>
                                        </p>
                                    </div>
                                </li>
                                }
                            }
                            else
                            {
                                <li>
                                    <div class="user-thumb" style="height: 60px; width: 50px">
                                        <img alt="没有编委会成员" style="height: 60px; width: 50px" src="/Content/img/demo/av3.jpg" />
                                    </div>
                                    <div class="comments">
                                        <p>
                                            <a>没有编委会成员</a>
                                        </p>
                                        <p>
                                            <span class="user-info">您还没有为您的期刊添加编委会成员！请尽快添加编委会成员已帮助您进行审稿<br />
                                                <a href="javascript:;" class="btn btn-primary btn-mini">查看</a> <a href="javascript:;"
                                                    class="btn btn-success btn-mini">添加编委会</a> </span>
                                        </p>
                                    </div>
                                </li>
                            }
                        }
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
@section tail{
    <script type="text/javascript">
        $(function () {
            $('#likmain').addClass('active');
        });
        function cancelarticle(id) {
            if (confirm('确认删除此稿件吗？')) {
                window.location.href = "/workspace/console/CancelArticle/" + id + "?group=1";
            }
        }
    </script>
}
